package com.cmii.sjw.department.control.jsc.controller;

import com.cmii.sjw.department.control.jsc.model.UniversityAppActivity;
import com.cmii.sjw.department.control.jsc.model.dto.UniversityAppActivityDTO;
import com.cmii.sjw.department.control.jsc.model.dto.UniversityOverviewDTO;
import com.cmii.sjw.department.control.jsc.service.UniversityAppActivityService;
import com.cmii.sjw.department.control.jsc.util.Result;
import org.springframework.web.bind.annotation.*;

import jakarta.annotation.Resource;
import java.util.List;

/**
 * 高校应用场景使用活跃度统计表
 *
 * @author lizheng
 * @date 2025-07-16
 */
@RestController
@CrossOrigin
@RequestMapping("/activity")
public class UniversityAppActivityController {

    @Resource
    private UniversityAppActivityService universityAppActivityService;

    /**
     * 高校应用场景使用活跃度统计表
     *
     * @return 列表
     */
    @PostMapping("/list")
    public Result<List<UniversityAppActivity>> list() {
        List<UniversityAppActivity> list = universityAppActivityService.list();
        return Result.success(list);
    }

    /**
     * 应用场景使用活跃度统计
     *
     * @return 统计数据
     */

    @PostMapping("/stats")
    public Result<UniversityAppActivityDTO> getAppActivityStats() {
        UniversityAppActivityDTO stats = universityAppActivityService.getAppActivityStats();
        return Result.success(stats);
    }

    /**
     * 高校所有数据统计
     *
     * @return 统计数据
     */

    @PostMapping("/allstats")
    public Result<UniversityOverviewDTO> getUniversityOverviewStats() {
        UniversityOverviewDTO stats = universityAppActivityService.getUniversityOverviewStats();
        return Result.success(stats);
    }
}
